Use AC_USE_SYSTEM_EXTENSIONS to get _GNU_SOURCE, _XOPEN_SOURCE etc.
authorSimon McVittie <smcv@debian.org>
Sun, 17 Aug 2014 14:00:54 +0000 (15:00 +0100)
committerSimon McVittie <smcv@debian.org>
Thu, 21 Aug 2014 08:54:12 +0000 (09:54 +0100)
Similar to Bug #684123 in GLib.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=641638
Bug-Debian: https://bugs.debian.org/756476
Reviewed-by: Matthias Clasen
configure.ac
gdk/wayland/gdkdevice-wayland.c
gtk/fnmatch.c
gtk/gtkscalebutton.c
gtk/gtksearchenginesimple.c
modules/printbackends/cups/gtkprintbackendcups.c

index 44064032116268299cb4ded292c6ae3bffd091a3..a814abe73f43fee7cac868dc9c93a7526317074a 100644 (file)
@@ -227,6 +227,8 @@ LT_INIT([disable-static win32-dll])
 # Create libtool early, because it's used in configure
 LT_OUTPUT
 
+# Define _GNU_SOURCE etc. where appropriate, e.g. for strptime() on glibc
+AC_USE_SYSTEM_EXTENSIONS
 # Make sure we use 64-bit versions of various file stuff.
 AC_SYS_LARGEFILE
 
index 37c6a94d8a6fd2fec9873820d4060655d07de535..efe413ab3dae9f3a109f086e8d20e8c64c5cd197 100644 (file)
@@ -15,7 +15,6 @@
  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define _GNU_SOURCE
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
index e67052b56804b0dae37cec775e127e7946675c6c..87582cab692a5ca51f8d822954615b0f6b909f9b 100644 (file)
 
 #include <glib.h>
 
-/* We need to make sure that all constants are defined
- * to properly compile this file
- */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 static gunichar
 get_char (const char **str)
 {
index b4bda76656f5c12fdee09086e8a14072b1b78c14..c979f613f18ead2e49abb1d539fec36fdf0c5583 100644 (file)
@@ -36,9 +36,6 @@
 
 #include "gtkscalebutton.h"
 
-#ifndef _WIN32
-#define _GNU_SOURCE
-#endif
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
index 14750584a29c11c1d8a17520ebe0374cc24cf86f..4d8ff2f9080b41b926c59bab0f61e1496e784e39 100644 (file)
 
 #include "config.h"
 
-/* these must be defined even when HAVE_GNU_FTW is not defined
- * because (really) old versions of GNU libc have ftw.h but do
- * export ftw() and friends only if _XOPEN_SOURCE and _GNU_SOURCE
- * are defined. see bug #444097.
- */
-#define _XOPEN_SOURCE 600
-#define _GNU_SOURCE
-
 #ifdef HAVE_FTW_H
 #include <ftw.h>
 #endif
index a49bb2d71f88157c8d16caf65e22a8935fe5c9c9..69abd4978462c1a2a3f683915224100d41a99619 100644 (file)
  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef __linux__
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 #include <ctype.h>
 #include <unistd.h>